﻿<?php
require_once('../db/check_login.php');
require_once('../db/config.php');
$db=new db($config);
$data=$db->foundbyWhere('article');
foreach($data as $key=>$val){
$artclassData=$db->foundbyId('artclass',$val['type']);
$data[$key]['type']=$artclassData['name'];
}
?>
<p>服务器:2</p>
<p><a href="add.php">添加新闻</a></p>
<table width="100%" border="0">
  <tr>
    <td width="9%"><div align="center">类别</div></td>
    <td width="52%"><div align="center">标题</div></td>
    <td width="21%"><div align="center">发布时间</div></td>
    <td width="18%"><div align="center">操作</div></td>
  </tr>
  <?php foreach($data as $val):?>
  <tr>
  <td><div align="center"><?php echo $val['type']?></div></td>
  <td><div align="center"><a href="read.php?id=<?php echo $val['id'];?>"><?php echo $val['title']?></a></div></td>
  <td><div align="center"><?php echo $val['sub_time']?></div></td>
  <td><div align="center"><a href="read.php?id=<?php echo $val['id'];?>">查看</a>
  <a href="update.php?id=<?php echo $val['id'];?>">修改</a>
  <a href="del.php?id=<?php echo $val['id'];?>">删除</a>
  </div></td>
  </tr>
  <?php endforeach; ?>
</table>
